import { createRouter, createWebHistory } from 'vue-router'
import routes from './routes'

const router = createRouter({
  routes,
  history: createWebHistory(),
  // ...跳转滚动条行为
  scrollBehavior() {
    return { left: 0, top: 0 }
  }

})
router.beforeEach((to, from, next) => {
  console.log("全局前置守卫");
  next()
})
router.beforeResolve((to, from, next) => {
  console.log("全局解析守卫");
  next()
})
router.afterEach((to, from) => {
  console.log("全局后置钩子");

})

export default router